package net.chenyan.server.controller.admapi;/**
 * @author chenyan
 * @createTime 2022/5/10 22:49
 * @description description
 */

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.chenyan.commons.core.R;
import net.chenyan.server.dto.UserLoginDTO;
import net.chenyan.server.po.Singer;
import net.chenyan.server.service.SingerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *@description: TODO
 *@author: chenyan
 *@create: 2022/5/10 22:49
 */
@Slf4j
@Api(tags = {"展示歌手信息接口"})
@RestController
@RequestMapping(value = "/admapi/singer")
public class SingerController {
    @Autowired
    private SingerService singerService;

    @ApiOperation(value = "展示歌手信息")
    @PostMapping("/getSinger")
    public R getSinger(@Validated @RequestBody int singerId) {
        Singer singer=singerService.getById(singerId);
        if(singer==null){
            return R.error("歌手id错误");
        }
        return R.data(singer);
    }
}
